﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp7
{
    class Program1
    {
        static void Main(string[] args)
        {
            string key;
            Console.WriteLine("请输入炒菜或者传菜");
            key = Console.ReadLine();
            Robot a = Tsat(key);
            a.Working();

        }
        public static Robot Tsat(string key)
        {
            Robot a;
            int s;
            switch (key)
            {
                case "炒菜":
                    Console.WriteLine("请问你要炒什么菜系的菜:1.铁锅炖大鹅     2.火烧");
                    s = int.Parse(Console.ReadLine());
                    if (s == 1)
                    {
                        a = new CookRobot("炒菜机器人", cai.铁锅炖大鹅);
                    }
                    else if (s == 2)
                    {
                        a = new CookRobot("炒菜机器人", cai.火烧);
                    }
                    else
                    {
                        Console.WriteLine("选择出错，默认选择火烧");
                        a = new CookRobot("炒菜机器人", cai.火烧);
                    }
                    break;
                case "传菜":
                    Console.WriteLine("请输入传菜机器人的时长:");
                    int jiu = int.Parse(Console.ReadLine());
                    a = new DeliveryRobot("传菜机器人", jiu);
                    break;
                default:
                    Console.WriteLine("输入错误自动选择炒菜机器人");
                    a = new CookRobot("", cai.火烧);
                    break;
            }
            return a;
        }
    }
    }

